package com.baizhi.controller;

import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import com.baizhi.entity.Brand;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.FileInputStream;
import java.util.List;

@Controller
@RequestMapping("/brand")
public class Oss {

    @ResponseBody
    @GetMapping()
    public void easypoia() throws Exception {//导入
        FileInputStream inputStream = new FileInputStream("g:/cv.xls");

        ImportParams importParams = new ImportParams();
        importParams.setTitleRows(1);
        importParams.setHeadRows(1);

        List<Brand> BzBrands = ExcelImportUtil.importExcel(inputStream, Brand.class, importParams);


    }


}
